import i18n from "@/i18n";

export const passwordValid = [
    {
        required: true,
        message: i18n.t('reset_password.password_valid_fail'),
        trigger: ['blur', 'change'],
        pattern: /^\S*(?=\S{8,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])(?=\S*[!@#$%^&*? ])\S*$/
    }
]

export const emailValid = [
    {
        required: true,
        message: i18n.t('reset_password.email_valid_fail'),
        trigger: ['blur', 'change'],
        pattern: /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
    }
]

export const authCodeValid = [
    {
        required: true,
        message: i18n.t('reset_password.captcha_not_empty'),
        trigger: ['blur', 'change']
    },{
        len: 4,
        message: i18n.t('reset_password.captcha_over_length'),
        trigger: 'blur'
    }
]